<template>
  <button
    :open-type="openType"
    :class="['my-button', className]"
    @click="handleClick"
  >
    <slot />
  </button>
</template>

<script>
export default defineComponent({
  name: 'MyButton',
  props: {
    openType: {
      type: String,
      default: ''
    },
    className: {
      type: String,
      default: ''
    }
  },
  setup (props, { emit }) {
    // 定义一个响应式引用，用来处理点击事件
    const handleClick = () => {
      // 触发一个名为 'click' 的自定义事件
      emit('click')
    }

    // 返回给模板的响应式引用
    return {
      handleClick
    }
  }
})
</script>
<style lang="scss" scoped>

button::after {
  border: none;
}
</style>
